package cn.doitedu.utils;

import java.io.*;

public class PageInfoProcess {
    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new FileReader("./page_prefix_origin.csv"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("./puts.txt"));

        String line = null;
        while ((line = br.readLine()) != null) {
            String[] fields = line.split(",");
            String urlPrefix = fields[0];


            /**
             * put 'dim_page_info','/mall/','f:page_type','商品详情页'
             * put 'dim_page_info','/mall/','f:page_service','商城服务'
             * put 'dim_page_info','/mall/','f:page_lanmu','A'
             * put 'dim_page_info','/mall/','f:page_pindao','C'
             */

            String put1 = "put 'dim_page_info','" + urlPrefix + "','f:page_type','"+  fields[1]+  "' \n";
            String put2 = "put 'dim_page_info','" + urlPrefix + "','f:page_service','"+fields[2]+"' \n";
            String put3 = "put 'dim_page_info','" + urlPrefix + "','f:page_lanmu','"+fields[3]+"' \n";
            String put4 = "put 'dim_page_info','" + urlPrefix + "','f:page_pindao','"+fields[4]+"' \n";

            bw.write(put1);
            bw.write(put2);
            bw.write(put3);
            bw.write(put4);
        }

        bw.close();
        br.close();

    }
}
